package entity

/**
 * @ClassName CustomEntity
 * @Description 面向对象  属性 默认 为public   继承 扩展 多态  内部类 抽象类  接口 和 Java 区别不大
 * @Author daoxuan
 * @create: 2019-09-12 15:26
 * @Version 1.0
 */

class CustomEntity {

    int id;
    String name;

    static void main(String[] args) {

        def entity = new CustomEntity()
        entity.setName("kjskd")
        entity.setId(2)
        println entity
    }

    CustomEntity() {
    }

    CustomEntity(int id, String name) {
        this.id = id
        this.name = name
    }

    @Override
    public String toString() {
        return "CustomEntity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
